﻿///////////////////////////////////////////////////////////////
// This is generated code. 
//////////////////////////////////////////////////////////////
// Code is generated using LLBLGen Pro version: 2.6
// Code is generated on: Tuesday, July 12, 2011 11:08:16 AM
// Code is generated using templates: SD.TemplateBindings.SharedTemplates.NET20
// Templates vendor: Solutions Design.
// Templates version: 
//////////////////////////////////////////////////////////////
using System;
using System.Collections;
using System.Collections.Generic;
using DatabaseGeneric;
using DatabaseGeneric.FactoryClasses;
using DatabaseGeneric.HelperClasses;
using SD.LLBLGen.Pro.ORMSupportClasses;

namespace DatabaseGeneric.RelationClasses
{
	/// <summary>Implements the static Relations variant for the entity: ChungLoaiSanPham. </summary>
	public partial class ChungLoaiSanPhamRelations
	{
		/// <summary>CTor</summary>
		public ChungLoaiSanPhamRelations()
		{
		}

		/// <summary>Gets all relations of the ChungLoaiSanPhamEntity as a list of IEntityRelation objects.</summary>
		/// <returns>a list of IEntityRelation objects</returns>
		public virtual List<IEntityRelation> GetAllRelations()
		{
			List<IEntityRelation> toReturn = new List<IEntityRelation>();
			toReturn.Add(this.SanPhamEntityUsingMaChungLoaiSanPham);
			toReturn.Add(this.SanPhamKhuonEntityUsingMaChungLoaiSanPham);


			return toReturn;
		}

		#region Class Property Declarations

		/// <summary>Returns a new IEntityRelation object, between ChungLoaiSanPhamEntity and SanPhamEntity over the 1:n relation they have, using the relation between the fields:
		/// ChungLoaiSanPham.MaChungLoaiSanPham - SanPham.MaChungLoaiSanPham
		/// </summary>
		public virtual IEntityRelation SanPhamEntityUsingMaChungLoaiSanPham
		{
			get
			{
				IEntityRelation relation = new EntityRelation(SD.LLBLGen.Pro.ORMSupportClasses.RelationType.OneToMany, "SanPham" , true);
				relation.AddEntityFieldPair(ChungLoaiSanPhamFields.MaChungLoaiSanPham, SanPhamFields.MaChungLoaiSanPham);
				relation.InheritanceInfoPkSideEntity = InheritanceInfoProviderSingleton.GetInstance().GetInheritanceInfo("ChungLoaiSanPhamEntity", true);
				relation.InheritanceInfoFkSideEntity = InheritanceInfoProviderSingleton.GetInstance().GetInheritanceInfo("SanPhamEntity", false);
				return relation;
			}
		}

		/// <summary>Returns a new IEntityRelation object, between ChungLoaiSanPhamEntity and SanPhamKhuonEntity over the 1:n relation they have, using the relation between the fields:
		/// ChungLoaiSanPham.MaChungLoaiSanPham - SanPhamKhuon.MaChungLoaiSanPham
		/// </summary>
		public virtual IEntityRelation SanPhamKhuonEntityUsingMaChungLoaiSanPham
		{
			get
			{
				IEntityRelation relation = new EntityRelation(SD.LLBLGen.Pro.ORMSupportClasses.RelationType.OneToMany, "SanPhamKhuon" , true);
				relation.AddEntityFieldPair(ChungLoaiSanPhamFields.MaChungLoaiSanPham, SanPhamKhuonFields.MaChungLoaiSanPham);
				relation.InheritanceInfoPkSideEntity = InheritanceInfoProviderSingleton.GetInstance().GetInheritanceInfo("ChungLoaiSanPhamEntity", true);
				relation.InheritanceInfoFkSideEntity = InheritanceInfoProviderSingleton.GetInstance().GetInheritanceInfo("SanPhamKhuonEntity", false);
				return relation;
			}
		}
        /// <summary>Returns a new IEntityRelation object, between ChungLoaiSanPhamEntity and SanPhamKhuonEntity over the 1:n relation they have, using the relation between the fields:
        /// ChungLoaiSanPham.MaChungLoaiSanPham - SanPhamKhuon.MaChungLoaiSanPham
        /// </summary>
        public virtual IEntityRelation SanPhamClastEntityUsingMaChungLoaiSanPham
        {
            get
            {
                IEntityRelation relation = new EntityRelation(SD.LLBLGen.Pro.ORMSupportClasses.RelationType.OneToMany, "SanPhamClast", true);
                relation.AddEntityFieldPair(ChungLoaiSanPhamFields.MaChungLoaiSanPham, SanPhamKhuonFields.MaChungLoaiSanPham);
                relation.InheritanceInfoPkSideEntity = InheritanceInfoProviderSingleton.GetInstance().GetInheritanceInfo("ChungLoaiSanPhamEntity", true);
                relation.InheritanceInfoFkSideEntity = InheritanceInfoProviderSingleton.GetInstance().GetInheritanceInfo("SanPhamClastEntity", false);
                return relation;
            }
        }


		/// <summary>stub, not used in this entity, only for TargetPerEntity entities.</summary>
		public virtual IEntityRelation GetSubTypeRelation(string subTypeEntityName) { return null; }
		/// <summary>stub, not used in this entity, only for TargetPerEntity entities.</summary>
		public virtual IEntityRelation GetSuperTypeRelation() { return null;}

		#endregion

		#region Included Code

		#endregion
	}
}
